package cn.itcast.controller;

import cn.itcast.domain.Cart;
import cn.itcast.service.UserService;
import com.github.pagehelper.PageHelper;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
import java.util.List;

@Controller
@RequestMapping("/cart")
public class CartController {

    @Resource
    private UserService service;

    @RequestMapping(value = "/findShop.do",method = RequestMethod.POST)
    @ResponseBody
    public List<Cart> findShop(Integer pageNum){
        PageHelper.startPage(pageNum,3);
        List<Cart>list=service.findshop();
        return list;
    }
}
